<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=gb2312" />
		<title>Common Template Engine</title>
		<meta name="keywords" content="commontemplate ctl template language engine code generator" />
		<style type="text/css">
			body {
				margin: 0px;
				padding: 0px;
				font-family: Arial, Helvetica, sans-serif;
				font-size: 12px;
				color: #000000;
				cursor: url('../images/cursor.cur');
			}

			td {
				font-size: 12px;
				height: 26;
			}

			img {
				border: 0px;
				clear: right;
			}

			input {
				font-family: Arial, Helvetica, sans-serif;
				font-size: 12px;
				color: #000000;
			}

			a:link {
				font-size: 12px;
				color: #003399;
				text-decoration: none;
			}
			a:visited {
				font-size: 12px;
				color: #003399;
				text-decoration: none;
			}
			a:active {
				font-size: 12px;
				color: #003399;
				text-decoration: none;
			}
			a:hover {
				font-size: 12px;
				color: #003399;
				text-decoration: underline;
			}
		</style>
	</head>
	<body>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="66">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td rowspan="2" height="60"><a href="http://www.commontemplate.org"><img src="../images/banner.gif" alt="Common Template Engine" border="0" width="400" height="50" /></a></td>
							<td height="40" valign="top" align="right">
								
								<a href="../../en/index.html">Release</a>
								|
								Build
								
								&gt;&gt;&nbsp;
								
								English
								
								|
								
								<a href="../zh/index.html">&#20013;&#25991;</a>
								
							</td>
						</tr>
						<tr>
							<td height="20" valign="bottom" align="right">
								<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid; border-color: #CCCCCC;">
									<tr align="center">
										
										<td width="90" height="20" style="font-weight: bold;"><a href="downloads.html" target="_self">Downloads</a></td>
										
										<td width="90" height="20" style="font-weight: bold;"><a href="changes.html" target="_self">Changes Log</a></td>
										
										<td width="90" height="20" style="font-weight: bold;"><a href="http://forum.commontemplate.org/index.php" target="_blank">Forums</a></td>
										
										<td width="90" height="20" style="font-weight: bold;"><a href="about.html" target="_self">About Us</a></td>
										
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td colspan="2" height="6" style="background-color: #005B88;"></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="200" valign="top">
								<table width="100%" border="1" style="border-collapse: collapse; border-style: solid; border-color: #CCCCCC;" cellspacing="1" cellpadding="2">
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="4" height="22" style="background-color: #0055CC;"></td>
													<td width="4"></td>
													<td style="font-weight: bold;">Documents</td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="index.html" target="_self">Overview</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="template.html" target="_self">Template Reference</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="expression.html" target="_self">Expression Reference</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="config.html" target="_self">Config Guide</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="integration.html" target="_self">Web Integration Guide</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="extension.html" target="_self">Expansion Guide</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="api.html" target="_self">API Guide</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="dependency.html" target="_self">Dependency Library</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="data.html" target="_self">Data Format</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="faq.html" target="_self">FAQ</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="4" height="22" style="background-color: #0055CC;"></td>
													<td width="4"></td>
													<td style="font-weight: bold;">Tools</td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="debugger.html" target="_self">Debug Window</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="viewer.html" target="_self">Viewer</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="editor.html" target="_self">Editor PlugIn</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="code.html" target="_self">Code Generator</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="ant.html" target="_self">Ant TemplateTask</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="4" height="22" style="background-color: #0055CC;"></td>
													<td width="4"></td>
													<td style="font-weight: bold;">Development</td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="architecture.html" target="_self">Architecture Specification</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="criterion.html" target="_self">Develop Criterion</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="planning.html" target="_self">Project Planning</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="requirement.html" target="_self">Requirement</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="4" height="22" style="background-color: #0055CC;"></td>
													<td width="4"></td>
													<td style="font-weight: bold;">Resources</td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="downloads.html" target="_self">Downloads</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="../resources/license.txt" target="_blank">License</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="changes.html" target="_self">Changes Log</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="uml.html" target="_self">UML</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="../javadoc" target="_blank">Java Doc</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="../coverage" target="_blank">Coverage Report</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="4" height="22" style="background-color: #0055CC;"></td>
													<td width="4"></td>
													<td style="font-weight: bold;">Community</td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="about.html" target="_self">Developer Team</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="http://forum.commontemplate.org/index.php/index.php" target="_blank">Forums</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="http://code.google.com/p/commontemplate/w/list" target="_blank">Wiki</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="http://sourceforge.net/mail/?group_id=193256" target="_blank">Mail List</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="http://code.google.com/p/commontemplate/issues/list" target="_blank">Bugs List</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									<tr>
										<td height="24" style="background-color: #F4F4F4;">
											<table width="100%" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="16"></td>
													<td><a href="http://forum.commontemplate.org/post.php?action=newthread&fid=2&extra=page%3D1" target="_blank">Report Bugs Here !</a></td>
												</tr>
											</table>
										</td>
									</tr>
									
									
								</table>
							</td>
							<td width="20">&nbsp;</td>
							<td align="left" valign="top">
								<table width="100%" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td height="32" align="left" valign="bottom"><b><font size="3">Welcome to CommonTemplate</font></b></td>
									<tr>
									<tr>
										<td align="left"><hr width="30%" align="left" /></td>
									<tr>
									<tr>
										<td align="left">
											

								<b>1. What's the CommonTemplate?</b><br/>
								CommonTemplate is a "template engine",<br/>
								a generic tool to generate text output: HTML, XML, Mail, Java source code, etc.<br/>
								<br/>
								<b>2. Which feature of CommonTemplate?</b> <br/>
								1) Only one syntax rule: $directive{expression}<br/>
								2) WYSWYG in Dreamweaver and syntax coat is extensible. <br/>
								3) Microkernel. Everything is additional except core API. Standard directives such as "for" and "if" could be replaced.<br/>
								4) Better extensibility. The engine is just on the duty of translating the template into directive-tree. The directives will finish the rest of the job by themselves.<br/>
								<br/>
								<b>3. Where download CommonTemplate?</b><br/>
								Download from <a target="_blank" href="http://sourceforge.net">SourceForge</a> platform:<br/>
								<table>
									<tr>
										<td width="64" height="24" align="center" style="background-color: #003399;"><a href="downloads.html" style="color: #FFFFFF; font-weight: bold;">Download</a></td>
									</tr>
								</table>
								<br/>
								<b>4. How to write CTL?</b> <a href="template_guide.html">more...</a><br/>
								Only one syntax rule: $<a href="template_guide.html">directive</a>{<a href="expression_guide.html">expression</a>}<br/>
<font color="#3f7f5f">&lt;html&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;body&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$if{users&nbsp;!=&nbsp;null&nbsp;&amp;&amp;&nbsp;users.size&nbsp;&gt;&nbsp;0}<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;table&nbsp;<font color="#7f0055">border</font><font color="#000000">=</font><font color="#2a00ff">"1"</font>&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$for{user&nbsp;:&nbsp;users}<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;tr&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font>${for.index&nbsp;+&nbsp;1}<font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font>${user.name}<font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font>${user.coins}<font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/tr&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$end<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/table&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$end<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/body&gt;</font><br/>
<font color="#3f7f5f">&lt;/html&gt;</font><br/>
								<br/>
								HTML syntax coat: <font color="green">(WYSWYG)</font><br/>
								(1) Comment Syntax Coat<br/>
<font color="#3f7f5f">&lt;html&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;body&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f5fbf">&lt;!--$if{users&nbsp;!=&nbsp;null&nbsp;&amp;&amp;&nbsp;users.size&nbsp;&gt;&nbsp;0}--&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;table&nbsp;<font color="#7f0055">border</font><font color="#000000">=</font><font color="#2a00ff">"1"</font>&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f5fbf">&lt;!--$for{user&nbsp;:&nbsp;users}--&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;tr&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font><font color="#3f5fbf">&lt;!--$out{for.index&nbsp;+&nbsp;1}--&gt;</font>1<font color="#3f5fbf">&lt;!--$end--&gt;</font><font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font><font color="#3f5fbf">&lt;!--$out{user.name}--&gt;</font>james<font color="#3f5fbf">&lt;!--$end--&gt;</font><font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font><font color="#3f5fbf">&lt;!--$out{user.coins}--&gt;</font>2.00<font color="#3f5fbf">&lt;!--$end--&gt;</font><font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/tr&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f5fbf">&lt;!--$end--&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/table&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f5fbf">&lt;!--$end--&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/body&gt;</font><br/>
<font color="#3f7f5f">&lt;/html&gt;</font><br/>
								(2) Attribute Syntax Coat<br/>
<font color="#3f7f5f">&lt;html&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;body&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;table&nbsp;<font color="#7f0055">m:if</font><font color="#000000">=</font><font color="#2a00ff">"users&nbsp;!=&nbsp;null&nbsp;&amp;&amp;&nbsp;users.size&nbsp;&gt;&nbsp;0"</font>&nbsp;<font color="#7f0055">border</font><font color="#000000">=</font><font color="#2a00ff">"1"</font>&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;tr&nbsp;<font color="#7f0055">m:for</font><font color="#000000">=</font><font color="#2a00ff">"user&nbsp;:&nbsp;users"</font>&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font><font color="#3f7f5f">&lt;span&nbsp;<font color="#7f0055">m:out</font><font color="#000000">=</font><font color="#2a00ff">"for.index&nbsp;+&nbsp;1"</font>&gt;</font>james<font color="#3f7f5f">&lt;/span&gt;</font><font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font><font color="#3f7f5f">&lt;span&nbsp;<font color="#7f0055">m:out</font><font color="#000000">=</font><font color="#2a00ff">"user.name"</font>&gt;</font>james<font color="#3f7f5f">&lt;/span&gt;</font><font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;td&gt;</font><font color="#3f7f5f">&lt;span&nbsp;<font color="#7f0055">m:out</font><font color="#000000">=</font><font color="#2a00ff">"user.coins"</font>&gt;</font>2.00<font color="#3f7f5f">&lt;/span&gt;</font><font color="#3f7f5f">&lt;/td&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/tr&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/table&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3f7f5f">&lt;/body&gt;</font><br/>
<font color="#3f7f5f">&lt;/html&gt;</font><br/>
								<br/>
								<b>5 .How to use CommonTemplate API?</b> <a href="use_guide.html">more...</a><br/>
								<b>(1) Java: </b><font color="green">(&gt;=JRE1.5)</font><br/>
<font color="#3f7f5f">// import commontemplate module </font><br/>
<font color="#7f0055"><b>import</b></font> org.commontemplate.core.*; <br/>
<font color="#7f0055"><b>import</b></font> org.commontemplate.engine.*; <br/>
<font color="#7f0055"><b>import</b></font> org.commontemplate.standard.*; <br/>
<br/>
<font color="#7f0055"><b>import</b></font> java.util.*; <br/>
<br/>
<font color="#3f7f5f">// config and build factory </font><br/>
StandardConfiguration config = <font color="#7f0055"><b>new</b></font> StandardConfiguration(); <br/>
config.loadStandardConfiguration();<br/>
config.set...<br/>
config.add...<br/>
...<br/>
Factory factory = <font color="#7f0055"><b>new</b></font> Engine(config); <br/>
<br/>
<font color="#3f7f5f">// setting global context</font><br/>
GlobalContext globalContext = factory.getGlobalContext();<br/>
globalContext.defineVariable(<font color="#2a00ff">"name"</font>, <font color="#2a00ff">"value"</font>); <br/>
...<br/>
<br/>
<font color="#3f7f5f">// define data </font><br/>
Map model = ... <br/>
Appendable output = ... <br/>
Locale locale = ... <br/>
TimeZone timeZone = ... <br/>
<br/>
<font color="#3f7f5f">// setting context</font><br/>
Context context = factory.createContext(output, locale, timeZone);<br/>
context.defineAllVariables(model); <br/>
context.defineVariable(<font color="#2a00ff">"name"</font>, <font color="#2a00ff">"value"</font>); <br/>
... <br/>
<br/>
<font color="#3f7f5f">// run </font><br/>
Template template = factory.getTemplate("mytemplate.mtl"); <br/>
template.render(context); <br/>
<br/>
<font color="#3f7f5f">// clean (try finally) </font><br/>
context.clear(); <br/>
output.flush(); <br/>
output.close(); <br/>
								<br/>
								<b>(2) .Net: </b><font color="green">(&gt;=CLR2.0)</font><br/>
								......<br/>

	
										</td>
									<tr>
								</table>
							</td>
							<td width="20">&nbsp;</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="6" align="center"><hr width="94%" align="center"/></td>
			</tr>
			<tr>
				<td height="24" align="center">
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>
								Copyright &#169; 2007-2008 <a href="about.html">CommonTemplate Developer Team</a>
							</td>
							<td width="100" align="right">
								<a href="http://www.commontemplate.org"><img src="../images/logo.gif" border="0" /></a>
							</td>
							<td width="100" align="right">
								<a target="_blank" href="http://sourceforge.net" target="_blank"><img src="../images/sourceforge.jpg" border="0" /></a>
							</td>
						<tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>